package cn.brilliantfuture.commentry.entity;

// Generated 2011-11-3 13:34:34 by Hibernate Tools 3.3.0.GA

import static javax.persistence.GenerationType.IDENTITY;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.validator.Length;
import org.hibernate.validator.NotNull;

/**
 * StorageGridPurchaserNews generated by hbm2java
 */
@Entity
@Table(name = "storage_grid_purchaser_news", catalog = "cabinet")
public class StorageGridPurchaserNews implements java.io.Serializable {

	private static final long serialVersionUID = 1L;
	private Integer storageGridPurchaserNewsId;
	private Purchaser purchaser;
	private StorageGrid storageGrid;
	private String rfidSn;
	private Integer closing;
	private Integer delivery;
	private Date arrivalTime;
	private Date takeawayTime;
	private Integer pick;
	private Integer lockersId;
	private Integer locationId;
	private String orderInformationNumber;
	private Integer groupId;
	private String cardNumber;
	private String deviceSn;
	private Integer refund;
	private DeliveryPlan deliveryPlan;

	public StorageGridPurchaserNews() {
	}

	public StorageGridPurchaserNews(Purchaser purchaser,
			StorageGrid storageGrid, Integer delivery, Integer pick, Integer refund) {
		this.purchaser = purchaser;
		this.storageGrid = storageGrid;
		this.delivery = delivery;
		this.pick = pick;
		this.refund = refund;
	}

	public StorageGridPurchaserNews(Purchaser purchaser,
			StorageGrid storageGrid, String rfidSn, Integer closing,
			Integer delivery, Date arrivalTime, Date takeawayTime, Integer pick,
			Integer lockersId, Integer locationId,
			String orderInformationNumber, Integer groupId, String cardNumber,
			String deviceSn, Integer refund) {
		this.purchaser = purchaser;
		this.storageGrid = storageGrid;
		this.rfidSn = rfidSn;
		this.closing = closing;
		this.delivery = delivery;
		this.arrivalTime = arrivalTime;
		this.takeawayTime = takeawayTime;
		this.pick = pick;
		this.lockersId = lockersId;
		this.locationId = locationId;
		this.orderInformationNumber = orderInformationNumber;
		this.groupId = groupId;
		this.cardNumber = cardNumber;
		this.deviceSn = deviceSn;
		this.refund = refund;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "storage_grid_purchaser_news_id", unique = true, nullable = false)
	public Integer getStorageGridPurchaserNewsId() {
		return this.storageGridPurchaserNewsId;
	}

	public void setStorageGridPurchaserNewsId(Integer storageGridPurchaserNewsId) {
		this.storageGridPurchaserNewsId = storageGridPurchaserNewsId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "purchaser_id", nullable = false)
	@NotNull
	public Purchaser getPurchaser() {
		return this.purchaser;
	}

	public void setPurchaser(Purchaser purchaser) {
		this.purchaser = purchaser;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "storage_grid_id", nullable = false)
	@NotNull
	public StorageGrid getStorageGrid() {
		return this.storageGrid;
	}

	public void setStorageGrid(StorageGrid storageGrid) {
		this.storageGrid = storageGrid;
	}

	@Column(name = "rfid_sn", length = 45)
	@Length(max = 45)
	public String getRfidSn() {
		return this.rfidSn;
	}

	public void setRfidSn(String rfidSn) {
		this.rfidSn = rfidSn;
	}

	@Column(name = "closing")
	public Integer getClosing() {
		return this.closing;
	}

	public void setClosing(Integer closing) {
		this.closing = closing;
	}

	@Column(name = "delivery", nullable = false)
	public Integer getDelivery() {
		return this.delivery;
	}

	public void setDelivery(Integer delivery) {
		this.delivery = delivery;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "arrival_time", length = 19)
	public Date getArrivalTime() {
		return this.arrivalTime;
	}

	public void setArrivalTime(Date arrivalTime) {
		this.arrivalTime = arrivalTime;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "takeaway_time", length = 19)
	public Date getTakeawayTime() {
		return this.takeawayTime;
	}

	public void setTakeawayTime(Date takeawayTime) {
		this.takeawayTime = takeawayTime;
	}

	@Column(name = "pick", nullable = false)
	public Integer getPick() {
		return this.pick;
	}

	public void setPick(Integer pick) {
		this.pick = pick;
	}

	@Column(name = "lockers_id")
	public Integer getLockersId() {
		return this.lockersId;
	}

	public void setLockersId(Integer lockersId) {
		this.lockersId = lockersId;
	}

	@Column(name = "location_id")
	public Integer getLocationId() {
		return this.locationId;
	}

	public void setLocationId(Integer locationId) {
		this.locationId = locationId;
	}

	@Column(name = "order_information_number", length = 45)
	@Length(max = 45)
	public String getOrderInformationNumber() {
		return this.orderInformationNumber;
	}

	public void setOrderInformationNumber(String orderInformationNumber) {
		this.orderInformationNumber = orderInformationNumber;
	}

	@Column(name = "group_id")
	public Integer getGroupId() {
		return this.groupId;
	}

	public void setGroupId(Integer groupId) {
		this.groupId = groupId;
	}

	@Column(name = "card_number", length = 45)
	@Length(max = 45)
	public String getCardNumber() {
		return this.cardNumber;
	}

	public void setCardNumber(String cardNumber) {
		this.cardNumber = cardNumber;
	}

	@Column(name = "device_sn", length = 45)
	@Length(max = 45)
	public String getDeviceSn() {
		return this.deviceSn;
	}

	public void setDeviceSn(String deviceSn) {
		this.deviceSn = deviceSn;
	}

	@Column(name = "refund", nullable = false)
	public Integer getRefund() {
		return this.refund;
	}

	public void setRefund(Integer refund) {
		this.refund = refund;
	}

	@OneToOne
	@JoinColumn(name = "delivery_plan_id", unique = true)
	public DeliveryPlan getDeliveryPlan() {
		return deliveryPlan;
	}

	public void setDeliveryPlan(DeliveryPlan deliveryPlan) {
		this.deliveryPlan = deliveryPlan;
	}
}
